//package com.molyfun.parents.adapter;
//
//import android.content.Context;
//import android.support.v7.widget.RecyclerView;
//import android.view.LayoutInflater;
//import android.view.ViewGroup;
//
//import com.molyfun.parents.R;
//import com.molyfun.parents.activity.account.OnLikeOrCommentListLongClickListener;
//import com.molyfun.parents.activity.ask.view.AskTopBar;
//import com.molyfun.parents.activity.ask.view.TopicBriefView;
//import com.molyfun.parents.activity.common.listactivity.viewholder.HomelandViewHolder;
//import com.molyfun.parents.activity.common.listactivity.viewholder.TopicViewHolder;
//import com.molyfun.parents.activity.homeland.bean.HomelandBriefBean;
//import com.molyfun.parents.activity.homeland.view.HomelandBriefView;
//import com.molyfun.parents.view.TwoTabBar;
//
//import java.util.List;
//
///**
// * Created by william(liuchao.hit@gmail.com).
// * Date:28/07/2017.
// */
//
//public class MyLikeListAdapter extends BaseAdapter<HomelandBriefBean> {
//
//    private int mCurrentChooseTab = TwoTabBar.TwoTabChooseTab.BAR_ONE;
//
//    private OnLikeOrCommentListLongClickListener mOnLikeOrCommentListLongClickListener;
//
//    public MyLikeListAdapter(Context context, int chooseTab, OnLikeOrCommentListLongClickListener onLikeOrCommentListLongClickListener){
//        super(context);
//        this.mCurrentChooseTab = chooseTab;
//        this.mOnLikeOrCommentListLongClickListener = onLikeOrCommentListLongClickListener;
//    }
//
//    public void refreshData(List<HomelandBriefBean> list, int chooseTab) {
//
//        this.mCurrentChooseTab = chooseTab;
//        super.refreshData(list);
//    }
//
//    @Override
//    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//        if(mCurrentChooseTab == TwoTabBar.TwoTabChooseTab.BAR_ONE){
//            return new HomelandViewHolder(LayoutInflater.from(parent.getContext())
//                    .inflate(R.layout.layout_homeland_brief_cell, parent, false));
//        }else{
//            return new TopicViewHolder(LayoutInflater.from(parent.getContext())
//                    .inflate(R.layout.layout_topic_brief_cell, parent, false));
//        }
//    }
//
//    @Override
//    public void onBindViewHolder(RecyclerView.ViewHolder holder,final int position) {
//        if(mCurrentChooseTab == TwoTabBar.TwoTabChooseTab.BAR_ONE){
//            final HomelandBriefBean topicBean = mList.get(position);
////            topicBean.setUserid(MFPApplication.getInstance().getUser().getId());
//            HomelandViewHolder homelandViewHolder = (HomelandViewHolder)holder;
//            homelandViewHolder.mHomelandBriefView.initData(topicBean, HomelandBriefView.HomelandBriefViewType.VIEW_MODE_COMMENT);
//            homelandViewHolder.mHomelandBriefView.setOnTopicBriefViewCallback(new TopicBriefView.OnTopicBriefViewCallback() {
//                @Override
//                public void onTopicBriefDel() {
//                    mList.remove(position);
//                    notifyDataSetChanged();
//                }
//            });
//        }else{
//            TopicViewHolder topicViewHolder = (TopicViewHolder)holder;
//            final HomelandBriefBean topicBean = mList.get(position);
////            topicBean.setUserid(MFPApplication.getInstance().getUser().getId());
//            topicViewHolder.mTopicView.initData(topicBean, AskTopBar.AskBarChooseTab.BAR_MINE, TopicBriefView.TopicBriefViewType.VIEW_MODE_COMMENT);
//            topicViewHolder.mTopicView.setOnTopicBriefViewCallback(new TopicBriefView.OnTopicBriefViewCallback() {
//                @Override
//                public void onTopicBriefDel() {
//                    mList.remove(position);
//                    notifyDataSetChanged();
//                }
//            });
////            topicViewHolder.mTopicView.setOnLongClickListener(new View.OnLongClickListener() {
////                @Override
////                public boolean onLongClick(View v) {
////                    if (mOnLikeOrCommentListLongClickListener != null) {
////                        mOnLikeOrCommentListLongClickListener.onLlongClick(mList.get(position), position);
////                    }
////                    return false;
////                }
////            });
//        }
//
//    }
//
//    @Override
//    public int getItemViewType(int position) {
//        return mCurrentChooseTab;
//    }
//}
